﻿@{
    ViewBag.Title = "Admin";

    var sh = DrillOnline.Services.Scenarios.ScenariosHost.Instance;
    var ds = sh.Sessions.ContainsKey("default") ? sh.Sessions["default"] as DrillOnline.Services.DrillScenarios : null;
    
}
@Scripts.Render("~/bundles/jquery")
<script src="~/scripts/jquery.unobtrusive-ajax.js" type="text/javascript"></script>
<script src="~/Scripts/arttemplate.js"></script>

<h1>Admin</h1>
@using (Html.BeginForm("LoadScenarios", null, FormMethod.Post, new { enctype = "multipart/form-data" }))
{
    
    <ul>
        @if (ds != null)
        {
            try
            {
            <li>
                <h2>@ds.ScenariosName [@((new string[] { "停止", "暂停", "进行" })[ds.Timeline.Status])]</h2>
                <ul>
                    <li>@ds.SessionName</li>
                    <li>@ds.SessionKey</li>
                    <li>故事年代:@ds.Timeline.StoryBaseTime</li>
                    <li>长度:@ds.SceneList.Count</li>
                    <li>TimeRate:@ds.Timeline.Config_PlayingTimeRate</li>
                    <li>StoryCurrentTime:@ds.Timeline.StoryCurrentTime</li>
                    <li>PlayingSceneIndex:@ds.Timeline.PlayingSceneIndex</li>
                    <li>PlayingOffset:@ds.Timeline.PlayingOffset</li>
                </ul>
            </li>
            }
            catch { 
                
            }
        }
        <li>

            <h2>Load Scenarios</h2>
            <ul>
                <li>must select a srt file，try get one from <a href="http://www.shooter.cn/">射手网--电影字幕网站</a><br />
                    <input type="file" name="srtfile" /></li>
                <li>
                    <input type="text" name="storytime" value="1945-1-1" /></li>
                <li>
                    <input type="text" name="timerate" value="4" /></li>
                <li>
                    <input type="submit" name="submit" value="submit" /></li>
            </ul>

        </li>
        <li>
            <h2>Run Scenarios</h2>
            <ul>
                <li>@Html.ActionLink("Start", "Start")</li>
                <li>@Html.ActionLink("Pause", "Pause")</li>
                <li>@Html.ActionLink("Stop", "Stop")</li>
            </ul>

        </li>
        <li>
    </ul>
}